package com.sicau.socialpracticesystem.entity.vo.teammember;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sicau.socialpracticesystem.common.myenum.TeamMemberStateEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * <p>
 * 团队成员信息表
 * </p>
 *
 * @author sxt && ttxxi
 * @since 2021-04-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("team_member_vo")
@ApiModel(value = "TeamMember对象", description = "团队成员信息表")
public class TeamMemberVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "团队id")
    private Integer teamId;

    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @ApiModelProperty(value = "申请状态")
    private Integer state;

    @ApiModelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "团队名")
    private String teamName;

    @ApiModelProperty(value = "用户学号")
    private Integer userNumber;

    @ApiModelProperty(value = "角色 1：队长 2：成员")
    private Integer memberRole;

    public String getState() {
        TeamMemberStateEnum teamMemberStateEnum = TeamMemberStateEnum.getEnum(state);
        return teamMemberStateEnum != null ? teamMemberStateEnum.getProgress() : null;
    }
}
